<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="col-sm-12">
        <div class="ibox">
            <div class="ibox-body">
                <div class="fixed-table-toolbar">
                    <div class="columns pull-left">
                        <button shiro:hasPermission="system:productInner:add" type="button"
                                th:onclick="'javascript:add(\''+${project.projectId}+'\', \''+${sonsysDO.sonsysId}+'\');'" class="btn  btn-primary">
                            <i class="fa fa-plus" aria-hidden="true"></i>添加产品
                        </button>
                        <button shiro:hasPermission="system:productInner:batchRemove" type="button"
                                class="btn  btn-danger"
                                onclick="batchRemove()">
                            <i class="fa fa-trash" aria-hidden="true"></i>删除产品
                        </button>
                        <button type="button"
                                class="btn  btn-success"
                                th:onclick="'javascript:ReturnSonsys(\''+${project.projectId}+'\', \''+${sonsysDO.sonsysId}+'\');'">
                            <i class="fa fa-share" aria-hidden="true"></i>返回
                        </button>



                    </div>

                    <div class="col-md-2 col-md-offset-2" style="width: 300px;">
                        <input type="hidden" id="nowProjectId" th:value="${projectId}">
                        <input type="hidden" id="nowSonsysId" th:value="${sonsysDO.sonsysId}">
                        <h3>
                            <strong>
                                <span th:text="${sonsysDO.sonsysId}"></span>
                                <span>.</span>
                                <span th:text="${sonsysDO.sonsysName}"></span>
                                <button type="button" class="btn  btn-primary btn-xs" title="刷新当前子系统的报价信息"
                                        th:onclick="'javascript:buildsonmoney(\''+${sonsysDO.sonsysId}+'\', \''+${projectId}+'\');'">
                                    <i class="	glyphicon glyphicon-refresh" aria-hidden="true"></i></button>
                            </strong>
                        </h3>
                        <div class="" style="width: 400px">
                            <span>成本：</span>
                            <span id="sonchengben" th:text="${sonsysDO.sonchengben}"
                                  style="color: red;margin-right: 5px;"></span>
                            <span>  报价：</span>
                            <span id="sonbaojia" th:text="${sonsysDO.sonbaojia}"
                                  style="color: red;margin-right: 5px;"></span>
                            <span>  利润：</span>
                            <span id="sonjectlirun" th:text="${sonsysDO.sonlirun}"
                                  style="color: red;margin-right: 5px;"></span>

                        </div>
                    </div>

                    <div class="columns pull-right">
                        <button class="btn btn-success" onclick="reLoad()">查询</button>
                    </div>
                    <div class="columns pull-right col-md-2 nopadding">
                        <input id="searchName" type="text" class="form-control"
                               placeholder="点击查询试一下">
                    </div>
                </div>
                <table id="exampleTable" data-mobile-responsive="true" >
                </table>
            </div>
        </div>
    </div>
</div>
<!--shiro控制bootstraptable行内按钮看见性 来自bootdo的创新方案 -->
<div>
    <script type="text/javascript">
        var s_edit_h = 'hidden';
        var s_remove_h = 'hidden';
        var s_resetPwd_h = 'hidden';
    </script>
</div>
<div shiro:hasPermission="system:productInner:edit">
    <script type="text/javascript">
        s_edit_h = '';
    </script>
</div>
<div shiro:hasPermission="system:productInner:remove">
    <script type="text/javascript">
         s_remove_h = '';
    </script>
</div>
<div shiro:hasPermission="system:productInner:resetPwd">
    <script type="text/javascript">
         s_resetPwd_h = '';
    </script>
</div>
</div>
<div th:include="include :: footer"></div>
<script type="text/javascript" src="/js/appjs/system/productInner/productInner.js"></script>

<script type="text/javascript">

    function ReturnSonsys(projectId,sonsysId) {
        window.location="/system/sonsys/"+projectId;
    }
</script>

<script type="text/javascript">
    $(function () {
        var sonchengben = $("#sonchengben").text();
        $("#sonchengben").text(formatnum(sonchengben));

        var sonbaojia = $("#sonbaojia").text();
        $("#sonbaojia").text(formatnum(sonbaojia));

        var sonjectlirun = $("#sonjectlirun").text();
        $("#sonjectlirun").text(formatnum(sonjectlirun));



    })



    function formatnum(num) {

        return new Number(num);
    }


</script>

<script type="text/javascript" src="/js/appjs/system/productInner/edit.js"></script>

<script type="text/javascript" src="/js/appjs/system/productInner/add.js"></script>
</body>
</html>